package com.eastfair.pay.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.core.base.entity.Entity;
import com.eastfair.database.mybatis.typehandler.M9EncryptHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 发票申请
 * </p>
 *
 * @author clm
 * @since 2022-08-06
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value = "pay_invoice_applyer", autoResultMap = true)
@ApiModel(value = "InvoiceApplyer", description = "发票申请")
@AllArgsConstructor
public class InvoiceApplyer extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 发票业务类型枚举（合同发票，结算单发票，订单发票...）
     */
    @ApiModelProperty(value = "发票业务类型枚举（合同发票，结算单发票，订单发票...）")
    @Size(max = 64, message = "发票业务类型枚举（合同发票，结算单发票，订单发票...）长度不能超过64")
    @TableField(value = "business_type", condition = LIKE)
    @Excel(name = "发票业务类型枚举（合同发票，结算单发票，订单发票...）")
    private String businessType;

    /**
     * 客户id
     */
    @ApiModelProperty(value = "客户id")
    @TableField(value = "cutomer_id")
    @Excel(name = "客户id")
    private Long cutomerId;

    /**
     * 客户名称
     */
    @ApiModelProperty(value = "客户名称")
    @Size(max = 255, message = "客户名称长度不能超过255")
    @TableField(value = "cutomer_name", condition = LIKE)
    @Excel(name = "客户名称")
    private String cutomerName;

    /**
     * 客户分类
     */
    @ApiModelProperty(value = "客户分类")
    @Size(max = 255, message = "客户分类长度不能超过255")
    @TableField(value = "cutomer_type", condition = LIKE)
    @Excel(name = "客户分类")
    private String cutomerType;


    /**
     * 发票抬头
     */
    @ApiModelProperty(value = "发票抬头")
    @Size(max = 255, message = "发票抬头长度不能超过255")
    @TableField(value = "invoice_title", condition = LIKE)
    @Excel(name = "发票抬头")
    private String invoiceTitle;

    /**
     * 税号
     */
    @ApiModelProperty(value = "税号")
    @Size(max = 255, message = "税号长度不能超过255")
    @TableField(value = "invoice_duty_paragraph", condition = LIKE)
    @Excel(name = "税号")
    private String invoiceDutyParagraph;

    /**
     * 费用类型（数据字典）
     */
    @ApiModelProperty(value = "费用类型（数据字典）")
    @Size(max = 255, message = "费用类型（数据字典）长度不能超过255")
    @TableField(value = "cost_type", condition = LIKE)
    @Excel(name = "费用类型（数据字典）")
    private String costType;

    /**
     * 开票单位地址
     */
    @ApiModelProperty(value = "开票单位地址")
    @Size(max = 255, message = "开票单位地址长度不能超过255")
    @TableField(value = "company_address", condition = LIKE)
    @Excel(name = "开票单位地址")
    private String companyAddress;

    /**
     * 开票单位电话
     */
    @ApiModelProperty(value = "开票单位电话")
    @Size(max = 255, message = "开票单位电话长度不能超过255")
    @TableField(value = "company_tel", condition = LIKE, typeHandler = M9EncryptHandler.class)
    @Excel(name = "开票单位电话")
    private String companyTel;

    /**
     * 展会id
     */
    @ApiModelProperty(value = "展会id")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会id")
    private Long exhibitionId;

    /**
     * 展会名称
     */
    @ApiModelProperty(value = "展会名称")
    @Size(max = 255, message = "展会名称长度不能超过255")
    @TableField(value = "exhibition_name", condition = LIKE)
    @Excel(name = "展会名称")
    private String exhibitionName;

    /**
     * 对方账号
     */
    @ApiModelProperty(value = "对方账号")
    @Size(max = 255, message = "对方账号长度不能超过255")
    @TableField(value = "bank_account_num", condition = LIKE)
    @Excel(name = "对方账号")
    private String bankAccountNum;

    /**
     * 对方开户行
     */
    @ApiModelProperty(value = "对方开户行")
    @Size(max = 255, message = "对方开户行长度不能超过255")
    @TableField(value = "bank_name", condition = LIKE)
    @Excel(name = "对方开户行")
    private String bankName;

    /**
     * 税后开票金额
     */
    @ApiModelProperty(value = "税后开票金额")
    @TableField(value = "invoice_amount")
    @Excel(name = "税后开票金额")
    private BigDecimal invoiceAmount;

    /**
     * 优惠金额
     */
    @ApiModelProperty(value = "优惠金额")
    @TableField(value = "discount_amount")
    @Excel(name = "优惠金额")
    private BigDecimal discountAmount;

    /**
     * 申请人ID
     */
    @ApiModelProperty(value = "申请人ID")
    @TableField(value = "application_id")
    @Excel(name = "申请人ID")
    private Long applicationId;

    /**
     * 申请人姓名
     */
    @ApiModelProperty(value = "申请人姓名")
    @Size(max = 255, message = "申请人姓名长度不能超过255")
    @TableField(value = "application_name", condition = LIKE)
    @Excel(name = "申请人姓名")
    private String applicationName;

    /**
     * 取消申请时间
     */
    @ApiModelProperty(value = "申请日期")
    @TableField(value = "application_date")
    @Excel(name = "申请日期")
    private LocalDateTime applicationDate;

    /**
     * 收件人
     */
    @ApiModelProperty(value = "收件人")
    @Size(max = 255, message = "收件人长度不能超过255")
    @TableField(value = "addressee", condition = LIKE)
    @Excel(name = "收件人")
    private String addressee;

    /**
     * 收件人地址
     */
    @ApiModelProperty(value = "收件人地址")
    @Size(max = 255, message = "收件人地址长度不能超过255")
    @TableField(value = "to_address", condition = LIKE)
    @Excel(name = "收件人地址")
    private String toAddress;

    /**
     * 收件人手机号
     */
    @ApiModelProperty(value = "收件人手机号")
    @Size(max = 255, message = "收件人手机号长度不能超过255")
    @TableField(value = "mobile", condition = LIKE, typeHandler = M9EncryptHandler.class)
    @Excel(name = "收件人手机号")
    private String mobile;

    /**
     * 收件人邮箱
     */
    @ApiModelProperty(value = "收件人邮箱")
    @Size(max = 255, message = "收件人邮箱长度不能超过255")
    @TableField(value = "mailbox", condition = LIKE)
    @Excel(name = "收件人邮箱")
    private String mailbox;

    /**
     * 发票类型（数据字典)
     */
    @ApiModelProperty(value = "发票类型（数据字典)")
    @Size(max = 255, message = "发票类型（数据字典)长度不能超过255")
    @TableField(value = "invoice_type", condition = LIKE)
    @Excel(name = "发票类型（数据字典)")
    private String invoiceType;

    /**
     * 开票状态 数据字典
     */
    @ApiModelProperty(value = "开票状态 数据字典")
    @Size(max = 50, message = "开票状态 数据字典长度不能超过50")
    @TableField(value = "invoice_state", condition = LIKE)
    @Excel(name = "开票状态 数据字典")
    private String invoiceState;

    /**
     * 回调服务名称
     */
    @ApiModelProperty(value = "回调服务名称")
    @Size(max = 255, message = "回调服务名称长度不能超过255")
    @TableField(value = "callback_service_name", condition = LIKE)
    @Excel(name = "回调服务名称")
    private String callbackServiceName;

    /**
     * 回调接口地址
     */
    @ApiModelProperty(value = "回调接口地址")
    @Size(max = 255, message = "回调接口地址长度不能超过255")
    @TableField(value = "callbakc_api", condition = LIKE)
    @Excel(name = "回调接口地址")
    private String callbakcApi;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Size(max = 255, message = "备注长度不能超过255")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "备注")
    private String remark;

    /**
     * 系统标识
     */
    @ApiModelProperty(value = "系统标识")
    @Size(max = 255, message = "系统标识长度不能超过255")
    @TableField(value = "system_scene", condition = LIKE)
    @Excel(name = "系统标识")
    private String systemScene;
    /**
     * 系统标识
     */
    @ApiModelProperty(value = "发票详情")
    @Size(max = 255, message = "发票详情长度不能超过255")
    @TableField(value = "details", condition = LIKE)
    @Excel(name = "发票详情")
    private String details;

    /**
     * 审核状态
     */
    @ApiModelProperty(value = "审核状态")
    @Size(max = 255, message = "审核状态长度不能超过255")
    @TableField(value = "examine_state", condition = LIKE)
    @Excel(name = "审核状态")
    private String examineState;

    /**
     * 审核人
     */
    @ApiModelProperty(value = "审核人")
    @Size(max = 255, message = "审核人长度不能超过255")
    @TableField(value = "examiner", condition = LIKE)
    @Excel(name = "审核人")
    private String examiner;

    /**
     * 审核意见
     */
    @ApiModelProperty(value = "审核意见")
    @Size(max = 255, message = "审核意见长度不能超过255")
    @TableField(value = "examine_reason", condition = LIKE)
    @Excel(name = "审核意见")
    private String examineReason;

    /**
     * 审核人id
     */
    @ApiModelProperty(value = "审核人id")
    @TableField(value = "examine_id")
    @Excel(name = "审核人id")
    private Long examineId;

    /**
     * 开票单位
     */
    @ApiModelProperty(value = "开票单位")
    @TableField(value = "invoice_company")
    @Excel(name = "开票单位")
    private String invoiceCompany;


    /**
     * 业务单号(废弃)
     */
    @ApiModelProperty(value = "业务单号逗号隔开")
    @TableField(value = "business_nums")
    @Excel(name = "业务单号")
    private String businessNums;
    /**
     * 发票申请关联的业务id
     */
    @ApiModelProperty(value = "发票申请关联的业务id")
    @TableField(value = "business_id")
    private String businessId;

    /**
     * 发票申请关联的业务单号
     */
    @ApiModelProperty(value = "发票申请关联的业务单号")
    @TableField(value = "business_num")
    private String businessNum;

    /**
     * 荆艺开票申请流水
     */
    @ApiModelProperty(value = "荆艺开票申请流水")
    @TableField(value = "mainno")
    @Excel(name = "荆艺开票申请流水")
    private String mainno;


    @Builder
    public InvoiceApplyer(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime,
                          Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId,
                          String businessType, Long cutomerId, String cutomerName, String invoiceTitle, String invoiceDutyParagraph, String costType,
                          String companyAddress, String companyTel, Long exhibitionId, String exhibitionName, String bankAccountNum, String bankName,
                          BigDecimal invoiceAmount, Long applicationId, String applicationName, String addressee, String toAddress, String mobile,
                          String mailbox, String invoiceType, String invoiceState, String callbackServiceName, String callbakcApi, String remark) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.businessType = businessType;
        this.cutomerId = cutomerId;
        this.cutomerName = cutomerName;
        this.invoiceTitle = invoiceTitle;
        this.invoiceDutyParagraph = invoiceDutyParagraph;
        this.costType = costType;
        this.companyAddress = companyAddress;
        this.companyTel = companyTel;
        this.exhibitionId = exhibitionId;
        this.exhibitionName = exhibitionName;
        this.bankAccountNum = bankAccountNum;
        this.bankName = bankName;
        this.invoiceAmount = invoiceAmount;
        this.applicationId = applicationId;
        this.applicationName = applicationName;
        this.addressee = addressee;
        this.toAddress = toAddress;
        this.mobile = mobile;
        this.mailbox = mailbox;
        this.invoiceType = invoiceType;
        this.invoiceState = invoiceState;
        this.callbackServiceName = callbackServiceName;
        this.callbakcApi = callbakcApi;
        this.remark = remark;
    }

}
